package org.pine.rabbitmq;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Direct 消息消费者
 * @author liucs
 */
@Component
public class DirectReceiver {
    /**
     * 通过@RabbitListener注解指定一个方法是一个消息消费方法
     * @param msg 消费的消息
     */
    @RabbitListener(queues = "hello-queue")
    public void handler1(String msg) {
        System.out.println("DirectReceiver:" + msg);
    }
}
